<template>
  <div>
    <button @click="changeTestData2">改变testData2</button>{{ arr }}
    <son1 />
  </div>
</template>

<script>
import Son1 from "../otherComonents/Son1.vue";
import { computed } from "vue";
export default {
  data() {
    return {
      arr: "abin",
    };
  },
  provide() {
    return {
      testData: "测试provide",
      testData2: computed(() => this.arr),
    };
  },
  components: {
    Son1,
  },
  methods: {
    changeTestData2() {
      this.arr = this.arr + "abin";
    },
  },
};
</script>

<style>
</style>